package top.jle.wx.proxy.domain.templateMsg;

import com.alibaba.fastjson2.JSONObject;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

@Getter
@Setter
public abstract class TemplateMessage {

    @Schema(title="目标粉丝OPENID，批量模式填入batch")
    private String touser;

    @Schema(title="模板ID")
    private String template_id;

    @Schema(title="消息体，根据模板构建")
    private JSONObject data;

    public boolean valid(){
        return StringUtils.isNotBlank(touser) && StringUtils.isNotBlank(template_id) && this.data!=null && !this.data.isEmpty();
    }

}
